package com.nt.train.entity;

/**
 * https://blog.csdn.net/A798194701/article/details/125504820
 * 详解Spring中Bean的生命周期
 * @author hlf
 * @version 1.0
 * @date 2022/8/15 18:35
 */
public class TestBean {

    private String name;

    public TestBean() {
        System.out.println("###################################");

        System.out.println("第一步 创建bean");
    }

    public void setName(String name) {
        this.name = name;
        System.out.println("第二步 设置属性值");
    }

    public void myInit() {
        System.out.println("第三步 bean被初始化");
    }

    public void myDestory() {
        System.out.println("第五步 bean被销毁");
    }

    public String getName() {
        return name;
    }
}
